package com.github.postsanf.yinian.fragment;

import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.github.postsanf.yinian.BaseFragment;
import com.github.postsanf.yinian.R;
import com.github.postsanf.yinian.activity.PcIntroduceActivity;


public class LinkFragment extends BaseFragment implements View.OnClickListener {
    private View view;
    private ImageView iv_pc;
    private ImageView iv_weixin;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_link, null);
        initView();
        return view;
    }

    private void initView() {
        iv_pc = ((ImageView) view.findViewById(R.id.iv_pc));
        iv_weixin = ((ImageView) view.findViewById(R.id.iv_weixin));
        iv_pc.setOnClickListener(this);
        iv_weixin.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_pc:
                startActivity(new Intent(getActivity(), PcIntroduceActivity.class));
                break;
            case R.id.iv_weixin:
                startActivity(new Intent(getActivity(), PcIntroduceActivity.class).putExtra("weixin", "weixin"));
                break;
        }
    }
}
